package com.orangecy.flowengine.flow;

import com.orangecy.common.context.OrangeCyContext;
import lombok.Builder;
import lombok.Data;

/**
 * @Author : orangeCy.奕
 * @Time : 2021/9/12
 * @desc : 猎豹养成产品源码
 * 组件执行接口
 */
@Data
@Builder
public class EngineContext<T> extends OrangeCyContext {

    /**
     * 流程ID
     */
    private Long flowId;
    /**
     * 阶段流
     */
    private FlowPhaseEnum flowPhase;

    /**
     * 上下文携带者
     */
    private T param;

    public EngineContext copy(){
        return EngineContext.builder()
                .flowId(flowId)
                .flowPhase(flowPhase)
                .param(param)
                .build();
    }
}